import http from "@/utils/request";

export function getWarehouse(pageParam:any){
    console.log('发送请求参数:', pageParam)
    return http.request({
        url:"/glacier-hardware/warehouse/selectByPage",
        method:'get',
        params:pageParam
    }).then(response => {
        console.log('仓库列表API响应:', response)
        return response
    }).catch(error => {
        console.error('仓库列表API错误:', error)
        throw error
    })
}

export function postDeleteById(id:string){
    return http.request({
        url:`/glacier-hardware/warehouse/deleteById/?id=${id}`,
        method:'post'
    })
}

export function getType(){
   
    return http.request({
        url:"/glacier-hardware/warehouse/type",
        method:'get'
    })
}

export function getState(){
   
    return http.request({
        url:"/glacier-hardware/warehouse/state",
        method:'get'
    })
}

export function getFindById(id:string){
   
    return http.request({
        url:`/glacier-hardware/warehouse/findById/?id=${id}`,
        method:'get'
    })
}

export function updateById(ruleForm: any) {
    return http.request({
      url: "/glacier-hardware/warehouse/updateById",
      method: 'post',
      data: ruleForm
    });
  }

  export function add(ruleForm: any) {
    return http.request({
      url: "/glacier-hardware/warehouse/add",
      method: 'post',
      data: ruleForm
    });
  }
    

  